﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sunboxsoft.ASMS.Client.Domain.WebRef
{
    public partial class ESettlementBillPackageItem
    {
        public string PackageName { get; set; }
        public string PackageItemName { get; set; }
        public int PackageItemType { get; set; }

        /// <summary>
        /// 套餐项目类型文字
        /// </summary>
        public string PackageItemTypeText
        {
            get
            {
                if (PackageItemType == Constant.PackageItemTypes.ServiceItem)
                {
                    return "服务项";
                }
                else if (PackageItemType == Constant.PackageItemTypes.Voucher)
                {
                    return "代金券";
                }
                return "unknown";
            }
        }

        public decimal PackageItemValue { get; set; }
        /// <summary>
        /// 附属数据类型
        /// </summary>
        public int? PackageItemTagDataType { get; set; }

        /// <summary>
        /// 附属数据,如果是服务项目类型这个可以转换为Guid和ServiceItemId匹配
        /// </summary>
        public string PackageItemTagData { get; set; }

        /// <summary>
        /// 显示多少次/多少钱
        /// </summary>
        public string PackageItemValueText
        {
            get
            {
                if (this.PackageItemType == Constant.PackageItemTypes.ServiceItem)
                {
                    return string.Format("{0}次", (int)PackageItemValue);
                }
                else if (this.PackageItemType == Constant.PackageItemTypes.Voucher)
                {
                    return string.Format("{0}", PackageItemValue);
                }
                else
                {
                    return "unknown";
                }
            }
        }

        public ESettlementBillPackageItem()
        {
        }

        public ESettlementBillPackageItem(string packageName, string packageItemName, int packageItemType, decimal packageItemValue, int? packageItemTagDataType, string packageItemTagData)
        {
            PackageName = packageName;
            PackageItemName = packageItemName;
            PackageItemType = packageItemType;
            PackageItemValue = packageItemValue;
            PackageItemTagDataType = packageItemTagDataType;
            PackageItemTagData = packageItemTagData;
        }
    }
}
